package com.pds.web.testOrganizationInfo.excel;

import com.pds.common.core.domain.entity.SysDictData;
import com.pds.common.utils.spring.SpringUtils;
import com.pds.system.service.ISysDictDataService;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

@Component
public class DataSelectImpl {

    public List<String> getData(String dictType){
        List<String> arrayList = new ArrayList<>();
        ISysDictDataService bean = SpringUtils.getBean(ISysDictDataService.class);
        SysDictData dictData = new SysDictData();
        dictData.setDictType(dictType);
        List<SysDictData> list = bean.selectDictDataList(dictData);
        if(!Objects.isNull(list) && !list.isEmpty()){
            for (SysDictData data : list) {
                String dictLabel = data.getDictLabel();
                if(!Objects.isNull(dictLabel) && !dictLabel.isEmpty()){
                    arrayList.add(dictLabel);
                }
            }
        }
        return arrayList;
    }
}
